<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <script type="text/javascript">
    	$(document).ready(function(){
    	  set_input_keydown_event();
    	  $('#typeid').combobox({url:'queryDeptTypeList.action'});
    	  combobox_keypress('#typeid','#save');
    	  $('#save').click(function (){
    	  	$('#typeid_val').val($('#typeid').combobox('getValue'));
    	    str = get_checked_menu_items('#menutree');
    	    $('#checkedItems').val(str);
    	        	    
    	    $('#mod_role_form').form('submit', {
    		  url: 'modRoleInfo.action',error:function(message){
    		    alert('提交数据错误，服务器可能已关闭！系统返回:'+message);
    		  },success:function(data){
    		    var a = eval('(' + data + ')');
    		    $.messager.alert('修改角色', a.message, 'info',
    		    	function(){$('#rolename').focus();});
    		    
    		    if (a.result=='0'){
                  var $tbl = $('#role_table');
                  var row = $tbl.datagrid('getSelected');
                  var index = $tbl.datagrid('getRowIndex',row);
                  row.rolename=$('#rolename').val();
                  row.depttype=$('#typeid').combobox('getValue');
                  row.depttypename=$('#typeid').combobox('getText');
                  row.checkedItems=eval($('#checkedItems').val());
                  $tbl.datagrid('refreshRow', index);
    		  	  $('#mod_role_win').window('close');
    		    }
    		  }
    	    })
    	  });
    	
    	  $('#menutree').tree({url:'queryMenuTree.action'});
    	  $('#sel_rights_pane').panel();
    	  $('#mod_role_win').window();
     		$('#cancel').click(function (){
     			$('#mod_role_win').window('close');
    		});
    	  });
    </script>
	</head>
	<body>

    <div id="mod_role_win" fit="false" collapsible="false" shadow="false" 
        title="修改角色" resizable="false" minimizable="false" maximizable="false" 
    	closable="true" closed="true" modal="true" icon="icon-save" class="jquery_window">
    	<s:form id="mod_role_form" action="modRoleInfo" cssStyle="margin:0px,0px">
    		<input id="checkedItems" name="checkedItems" type="hidden"/>
    		<table height="94%">
    		<tr style="vertical-align: top">
    				<td width="280px"><div id="sel_rights_pane" collapsible="false" fit="true" 
    					title="选择角色权限" resizable="false" collapsible="false" minimizable="false" 
    					maximizable="false" noheader="false" closable="false"
    					style="margin:0px;padding:0px;overflow-y:scroll">
    					<ul id="menutree" checkbox="true"></ul></div></td>
    		<td>
    		<table style="margin:20px,40px;">
    			<tr style="vertical-align: top">
    				<td>
    					<table>
    						<tr height="28px">
			    				<td><s:label value="角色号：" for="roleno"></s:label></td>
    							<td><input id="roleno" style="width:200px"
			    					class="text_field_css" disabled="disabled"/>
			    					<input id="roleno_val" name="roleno" type="hidden"/></td>
    						</tr>
			    			<tr height="28px">
    							<td><s:label value="角色名称：" for="rolename"></s:label></td>
			    				<td><input id="rolename" name="rolename" style="width:200px"
    								maxlength=<s:property value="%{getText('ROLENAME_LEN')}"/>  
    								class="text_field_css"></input></td>
			    			</tr>
			    			<tr height="28px">
						    	<td align="right"><s:label value="所属机构类型：" for="typeid"></s:label></td>
			    				<td><s:textfield id="typeid" valueField="typeid" textField="typename" 
    								style="width:200px" editable="false" panelHeight="auto"></s:textfield>
			    				<s:hidden id="typeid_val" name="depttype"></s:hidden> </td>
			    			</tr>
			    			<tr>
    							<td colspan="2" align="center">
            						<button id="save" class="buttons_css" style="width:70px">
            							<label style="70px" class="save_css">保存</label></button>
            						<label style="width:20px"></label>
            						<button id="cancel" class="buttons_css" style="width:70px">
            							<label style="70px" class="cancel_css">返回</label></button>
			    				</td>
    						</tr>
			    		</table>
			    	</td>
    			</tr>
    		</table>
    	</td>
    	</tr>
    	</table>
    	</s:form>
    </div>
    </body>
</html>